#ifndef CONVERSION_H_
#define CONVERSION_H_

#include <string>
#include <utility>
#include <sstream>

//template translation to string
template<class T>
std::string toString(const T &x){
    std::stringstream ss;
    ss << x;
    return ss.str();
}

template<>
std::string toString(std::string const &x);

//template translation from string to types
template<class T>
bool fromString(std::string const &x,T &y){
	bool				ret(false);
	T 					out;
    std::istringstream	stream(x);
    ret	=	stream>>out;

    if(ret){
    	y	=	out;
    }
    return ret;
}

template<>
bool fromString(std::string const &x,std::string  &y);

#endif /* CONVERSION_H_ */
